/*
 * Copyright (C) 2018 Logos Technology Ltd.
 */

package com.logos.common.keepalive.deviceutil;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;

/**
 * Created by llx on 2018/11/14.
 * 建议放在自己的项目中
 */
public class HuaweiDeviceUtil {

    /**
     * 进入华为的应用设置界面
     * @param context *
     * @return *
     */
    public static boolean toConfigApp(Context context) {

        try {
            Intent intent = new Intent();
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");
            intent.setData(Uri.fromParts("package", context.getPackageName(), null));
            context.startActivity(intent);
            return true;
        } catch (Exception ex) {
            ex.printStackTrace();
            return false;
        }
    }
}
